package online.config;

import online.interceptor.GlobleInterceptor;
import online.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Auther: 狼芒
 * @Date: 2021/9/1 23:43
 * @Descrintion:
 * @version: 1.0
 */
@Configuration
public class AdminWebConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/", "/login", "/favicon.ico");
        registry.addInterceptor(new GlobleInterceptor())
                .addPathPatterns("/**");
    }
}
